from django import forms

class PollForm(forms.Form):
    question = forms.CharField(widget=forms.Textarea,
                               label="Your Question",
                               )
    pub_date = forms.DateTimeField()
    email = forms.EmailField(required=False,
                             widget=forms.EmailInput,
                             )
    password1 = forms.CharField(min_length=8,
                                widget=forms.PasswordInput,
                                label="Your password",
                                )

    # def clean_password1(self):
    #     pwd1 = self.cleaned_data['password1']
    #     num_pwd = len(pwd1)
    #     print pwd1, num_pwd
    #     if num_pwd < 8:
    #         raise forms.ValidationError("Your password is too short.")
    #     return pwd1
